package com.fulihui.systemcore.api;

import org.near.servicesupport.request.TRequest;
import org.near.servicesupport.result.BaseResult;
import org.near.servicesupport.result.TSingleResult;

import com.fulihui.systemcore.request.menu.*;
import com.fulihui.systemcore.response.menu.QueryMenuResponse;
import com.fulihui.systemcore.response.menu.QueryMenuSingleResponse;

/**
 * 菜单服务
 * @author leeson 2016年5月17日 下午3:10:48
 */
public interface MenuService {
    /**
     * 获取顶级菜单
     * @param request {@link QueryTopMenuRequest}
     * @return 返回单个菜单模型 {@link QueryMenuResponse}
     */
    TSingleResult<QueryMenuResponse> queryTopMenu(TRequest<QueryTopMenuRequest> request);

    /**
     * 查询子菜单
     * @param request {@link QueryChildMenuRequest}
     * @return 返回单个菜单模型 {@link QueryMenuResponse}
     */
    TSingleResult<QueryMenuResponse> queryChildMenu(TRequest<QueryChildMenuRequest> request);

    /**
     * 排序
     * @param request {@link SortRequest}
     * @return 返回服务调用结果 {@link BaseResult}
     */
    BaseResult sort(TRequest<SortRequest> request);

    /**
     * 创建
     * @param request {@link MenuCreateRequest}
     * @return 返回服务调用结果 {@link BaseResult}
     */
    BaseResult create(TRequest<MenuCreateRequest> request);

    /**
     * 修改
     * @param request {@link MenuUpdateRequest}
     * @return 返回服务调用结果 {@link BaseResult}
     */
    BaseResult update(TRequest<MenuUpdateRequest> request);

    /**
     * 删除
     * @param request {@link MenuDeleteRequest}
     * @return 返回服务调用结果 {@link BaseResult}
     */
    BaseResult delete(TRequest<MenuDeleteRequest> request);

    /**
     * 按ID查询菜单
     * @param request {@link QueryMenuByIdRequest}
     * @return 单个菜单模型 {@link QueryMenuSingleResponse}
     */
    TSingleResult<QueryMenuSingleResponse> queryById(TRequest<QueryMenuByIdRequest> request);

    /**
     * 按code查询菜单
     * @param request {@link QueryMenuByCodeRequest}
     * @return 返回单个菜单模型 {@link QueryMenuSingleResponse}
     */
    TSingleResult<QueryMenuSingleResponse> queryByCode(TRequest<QueryMenuByCodeRequest> request);
}